package ChainOfResponsibility;

import java.util.Random;

public class Client {
    public static void main(String[] args) {
        AbstractFruitSorter bfs,mfs,sfs;
        bfs = new BigFruitSorter(9);
        mfs = new MidFruitSorter(5);
        sfs = new SmallFruitSorter(2);

        bfs.setNextFruitSorter(mfs);
        mfs.setNextFruitSorter(sfs);

        Random rd = new Random();
        for(int i = 0; i < 1000; ++i)
        {
            int weight = rd.nextInt(10);
            bfs.sendFruit(weight,"橙子");
        }
        bfs.getFruitBox();
        mfs.getFruitBox();
        sfs.getFruitBox();
    }
}
